1. Field of the Invention
The invention relates to a method of painting graphics in computer graphics apparatuses, and more particularly to a method of painting graphics with improved efficiency.
2. Prior Art
An important aspect of painting graphics is how to identify the inside and outside regions of a graphic figure correctly; in other words, how accurately a painting region can be judged.
The rules for judging painting regions which have heretofore been employed include: a so-called even-odd rule and a non-zero winding number rule, and each of these rules has been used where appropriate as long as it serves the purpose.
The even-odd rule judges the inside and outside regions of a graphic figure based on whether or not the total of intersection counts (intersection point count) between a path, which is a segment forming the graphic figure, and a scanning line from the scanning start position is an even number or an odd number. And a region where the total of intersections changes from an odd number to an even number is treated as being a painting region (inside), while a region where the total of intersections changes from an even number to an odd number is treated as being a non-painting region (outside).
On the other hand, the non-zero winding number rule judges a region as follows. If a path intersecting a scanning line is a downward path, "1" is added to the intersection point counts, while if such a path is an upward path, "1" is subtracted from the intersection point counts with respect to that scanning line, and if the total of the intersection point counts from the scanning start position is "0", it is judged that the region is an outside region; otherwise, it is judged that the region is an inside region.
However, with such techniques, the case where the scanning line intersects a vertex indicating an extreme value or the case where the scanning line intersects a horizontal path cannot be well taken care of, thereby making it difficult to provide an accurate judgment of the painting region.
To overcome this problem, a technique for counting the intersection point count at an intersection point as "1" or "2" in accordance with the intersecting condition has been proposed in, e.g., Japanese Patent Unexamined Publication No. 192878/1987.
If, e.g., a scanning line intersects a vertex, this conventional art judges whether or not the vertex is an extreme point or a continuous point from the inclinations of the two paths which meet at that vertex. And if the vertex is an extreme point, "2" is given as its intersection point count, while if it is a continuous point, "1" is given.
Further, if a scanning line intersects a horizontal path, the intersection point count is set based on the inclinations of the two paths, each of which meets the start point and the end point of that horizontal path.
However, such conventional art requires calculations of the inclinations of the two paths meeting a vertex or the end points of a horizontal path, thereby making the operation complicated.
Further, lack of consideration for the case where a plurality of horizontal paths overlap on a single scanning line has made the painting region judgment incorrect.